import { MoneyCollectOutlined } from '@ant-design/icons';
import { JSONObject } from 'admin/schema/common';
import { Button } from 'antd';
import * as React from 'react';
import { useSelector } from 'react-redux';
import './index.scss';

export interface IProps {}

export default function BillingSystemLink(props: IProps) {
  const { billUrl } = useSelector((state: JSONObject) => state.systemConfig);
  const token = useSelector((state: JSONObject) => state.token);

  return (
    <div className="layout-header-link">
      <Button
        className="link-btn"
        type="primary"
        shape="round"
        icon={<MoneyCollectOutlined />}
        target="_blank"
        onClick={() => {
          window.open(billUrl, token);
        }}
      >
        计费后台
      </Button>
    </div>
  );
}
